use C351220_COASTALCLIMBING;

;with cte(name, [count])
as
(
	select replace(lower(FIRSTNAME + LASTNAME), ' ', '') MEMBERS, count(replace(lower(FIRSTNAME + LASTNAME), ' ', '')) from PRESALE group by FIRSTNAME, LASTNAME 
)

select P.* from cte c
inner join PRESALE P on c.NAME = replace(lower(P.FIRSTNAME + P.LASTNAME), ' ', '')
where [count] > 1
order by P.LASTNAME, P.DATEADDED desc

--delete from PRESALE where ID in ('3DBDBDDC-64E3-4837-A5B8-C07254F7C07F'), '5CA64C31-4CD1-408F-8E17-AD7882ED8180')--, '1958CE80-9A8B-4FD8-8025-E6207F1A67C2')
--select * from PRESALE 
